import logging
# ======= Action Executor =======
class ActionExecutor:
    def __init__(self, global_vars):
        self.global_vars = global_vars
        self.logger = logging.getLogger("action_executor")

    def find_available_small_bottle(self,):
        """
        寻找合适的小瓶。
        遍历 global_vars.small_bottle_id * 10 （如10, 20, 30...），
        检查 global_vars.small_bottle_current_status 是否有这个值，有则返回，没有返回 None。
        """
        # 这里假设 small_bottle_current_status 是int类型，代表当前小瓶的状态（如10、20、30）
        for sid in self.global_vars.small_bottle_id:
            bottle_status = sid * 10
            if bottle_status in self.global_vars.small_bottle_current_status:
                self.logger.info(f"找到合适小瓶：{bottle_status}")
                return bottle_status
        self.logger.info("没有找到合适的小瓶。")
        return None




    def chromatograph_collection(self):
        """Install the column"""
        self.logger.info("Installing column")
        # Implementation details...

    def uninstall_column(self):
        """Uninstall the column"""
        self.logger.info("Uninstalling column")
        # Implementation details...

    def column_equilibration(self) -> None:
        """Equilibrate the column"""
        self.logger.info("Equilibrating column")
        # Implementation details...

    def inject_sample(self) -> None:
        """Inject sample into the system"""
        input("是否继续收集，按回车键继续...")
        self.logger.info("Injecting sample")
        # Implementation details...


        # Implementation details...

